# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
pkgname=ktexteditor5
pkgver=5.115.0
pkgrel=0
pkgdesc="Advanced embeddable text editor"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later AND (LGPL-2.0-only OR LGPL-3.0-only)"
depends_dev="
	karchive5-dev
	kauth5-dev
	kconfig5-dev
	kguiaddons5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	kparts5-dev
	sonnet5-dev
	syntax-highlighting5-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
options="!check" # fail on builders
_repo_url="https://invent.kde.org/frameworks/ktexteditor.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/ktexteditor-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/ktexteditor-$pkgver"

replaces="ktexteditor<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
ce30c8e43d453e02c8f2f36087d145bf29e6f7740340868ce6740670856bb3c5dc10e310934facfcdbeef447a54d11faa96f1ff08b0173283c25f604760607a8  ktexteditor-5.115.0.tar.xz
"
